package com.example.demo.spring.source.extend;

import com.example.demo.Demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author WangtTao
 * @date 2020/8/12 17:00
 */
@Component
public class TulingApplicationListener implements ApplicationListener {
    @Autowired
    private Demo demo3;

    @Override
    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        System.out.println(demo3);
        System.out.println(applicationEvent.getSource());
    }
}
